Skip to content

fix(opencode-route-proxy): validate window timezone and daysOfWeek at load - #11450

Merged
dezren39 merged 1 commit into
mainfrom
fix/11176-route-window-tz-days
Nov 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fix/11176-route-window-tz-days

Conversation

@dezren39

@dezren39 dezren39 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Closes #11176

Before: a model_route_windows entry was checked at load only for its start/end. A typo elsewhere broke the gate without a word:

  • an unknown timezone (America/Chicagoo) made the window never match;
  • an unknown weekday ("funday") was ignored, so the window still matched its other days;
  • a string daysOfWeek ("fri") widened the window to every day.

After: config load names each such window with its bad value, and the window fails closed (never active), the same as a bad time already does. Valid windows behave as before, including windows with no timezone or daysOfWeek and full weekday names like "Wednesday".

How: a new windowProblems(win) checks start/end, timezone (an Intl.DateTimeFormat probe) and daysOfWeek (an array of weekday names). warnInvalidWindows prints its problems, and windowActive returns false when there are any.

Testing: node --test bin/opencode-route-proxy.test.mjs passes, 48 of 48. The new cases fail without the source change: the bad-timezone, string-days and unknown-day windows are named in the load log and never match, and a full weekday name still matches its day.


Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

… load

warnInvalidWindows only checked start/end. An unknown timezone made a
window silently never match, an unknown weekday silently dropped a day,
and a string daysOfWeek silently widened the window to every day.

One windowProblems() check now covers start/end, timezone and
daysOfWeek. Config load names each bad window with its offending
values, and windowActive fails closed for every problem it names, so a
malformed window is a loud no-match. Valid windows, including ones
with no timezone or daysOfWeek and full weekday names, evaluate as
before.

Closes #11176

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 marked this pull request as ready for review November 18, 2026 00:14
@dezren39
dezren39 requested a review from a team as a code owner November 18, 2026 00:14
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3b115885-c9e7-45c3-8003-0905fda48644
Commits

Reviewing files that changed from the base of the PR and between 583207b and 3b051cc.

Files selected for processing: 2

  • bin/opencode-route-proxy.mjs
  • bin/opencode-route-proxy.test.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T00:15:30.842165Z 3b051cc Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit 132b998 into main Nov 18, 2026
1 check passed
@dezren39
dezren39 deleted the fix/11176-route-window-tz-days branch November 18, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants